<?php

class clientsPrevQuestionairesWidgetComponents extends myComponents
{
  public function executeRender(sfWebRequest $request)
  {
     $this->pageNode = $this->getRoute()->getObject();
     
     if ($this->pageNode->getParameter() == 'clients') {
         $this->node = $this->pageNode;
     } else {
         $this->node = $this->pageNode->getParent();
     }     

     $this->questionaires = QuestionaireTable::getInstance()
             ->findByStructureIdAndIsActive($this->node->getId(), 0);
     
     if ($id = $request->getParameter('id')) {
        $this->selQuestionaire = QuestionaireTable::getInstance()->find($id);
     }
  }
}